home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Textdisplayers / MoreIsBetter / Paul.h < prev    next >
C/C++ Source or Header  |  1996-09-26  |  3KB  |  81 lines

  1. /********  The following declarations are used in most every program
  2.        written by Paul Kienitz.  Generally, I use a symbol table file
  3.        which includes exec/exec.h, libraries/dosextens.h, functions.h,
  4.        and this.  I have a separate symbol file for intuition.
  5.  ********/
  6.  
  7. #include <stdio.h>
  8.  
  9. #define put(S) fputs(S, stdout)
  10.  
  11. #define null 0L
  12. /* uppercase is a pain in the wazoo */
  13.  
  14. #define bip(T, B) ((T *) (B << 2))
  15. #define gbip(B) bip(void, B)
  16.  
  17. /* B is expected to be of type BPTR or BSTR.  In my version of <functions.h>,
  18. all functions that are declared as returning struct FileHandle * or struct
  19. Lock * (a nonexistent type; it's FileLock) or struct Segment * are changed to
  20. return type BPTR.  Also, CreateProc and DeviceProc are corrected to return
  21. struct MsgPort * instead of Process, which is in error. */
  22.  
  23. /* Ain't BPTR's dumb??  Wasn't it silly to use BCPL??
  24.  
  25. Further evidence, alongside George Michael, Margaret Thatcher, the National
  26. Front, Dr. Who, Boy George, Sting, Reg Mellor "the King of Ferret Legging",
  27. the Royal Family, the rise and collapse of Colonialism, and every piece of
  28. software ever written by MetaCompGrow, that the English are weenies.
  29. */
  30.  
  31. #define Alloc(S)    AllocMem((long) S, 0L)
  32. #define AllocP(S)   AllocMem((long) S, MEMF_PUBLIC)
  33. #define AllocZ(S)   AllocMem((long) S, MEMF_CLEAR)
  34. #define AllocCP(S)  AllocMem((long) S, MEMF_CHIP | MEMF_PUBLIC)
  35. #define AllocPZ(S)  AllocMem((long) S, MEMF_PUBLIC | MEMF_CLEAR)
  36. #define AllocCPZ(S) AllocMem((long) S, MEMF_CHIP | MEMF_PUBLIC | MEMF_CLEAR)
  37. #define NewR(T, R)  (T *) AllocMem((long) sizeof(T), R)
  38. #define New(T)      NewR(T, 0L)
  39. #define NewP(T)     NewR(T, MEMF_PUBLIC)
  40. #define NewZ(T)     NewR(T, MEMF_CLEAR)
  41. #define NewCP(T)    NewR(T, MEMF_CHIP | MEMF_PUBLIC)
  42. #define NewPZ(T)    NewR(T, MEMF_PUBLIC | MEMF_CLEAR)
  43. #define NewCPZ(T)   NewR(T, MEMF_CHIP | MEMF_PUBLIC | MEMF_CLEAR)
  44.   /* use P for most things with a Node in them, CP for IO/sound/graphics
  45.      data (like for an IORequest's io_Data), Z whenever you want.  We don't
  46.      provide for non-public chip allocation. */
  47. #define Free(T, A) FreeMem(A, (long) sizeof(T))
  48.  
  49.  
  50.  
  51. #define RLock(F) Lock(F, ACCESS_READ)
  52. #define WLock(F) Lock(F, ACCESS_WRITE)
  53. #define OOpen(F) Open(F, MODE_OLDFILE)
  54. #define NOpen(F) Open(F, MODE_NEWFILE)
  55.  
  56. typedef short bool;
  57. #define false 0
  58. #define true 1
  59.  
  60. typedef unsigned short ushort;
  61. typedef unsigned long ulong;
  62. typedef unsigned char ubyte;
  63.  
  64. typedef void *adr;
  65. typedef char *str;
  66. typedef str *stray;
  67.  
  68. #define bit(B) (1L << (B))
  69.  
  70. #define private static
  71. #define import extern
  72. #define PUBLIC
  73.  
  74. /*
  75. In case you have never done landscaping in the East Bay, I will explain that
  76. "Compgrow" is a compost/mulch product sold by the East Bay Municipal Utilities
  77. District, which is made from a mixture of sawdust and raw sewage.  Easterners
  78. may know of a similar product called "Milorganite".  Most commercial over-
  79. priced potting mix & soil conditioner sold in plastic bags is based on it.
  80. */
  81.